/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) 2023 HUAWEI TECHNOLOGIES CO., LTD.
 */
#ifndef __KVM_EULEROS_VPMEM_H
#define __KVM_EULEROS_VPMEM_H

#include <linux/mm_types.h>
#include <linux/kvm_types.h>

bool vma_is_valid(struct vm_area_struct *vma, bool write_fault);
int hva_to_pfn_remapped(struct vm_area_struct *vma, unsigned long addr, bool *async,
						bool write_fault, bool *writable, kvm_pfn_t *p_pfn);
bool hva_to_pfn_remapped_vpmem(unsigned long addr, bool *write_fault, bool *writable,
				kvm_pfn_t *pfn, pte_t *ptep, pmd_t *pmdp, int *r);
kvm_pfn_t vpmem_hva_to_pfn(unsigned long addr, bool atomic, bool *async,
						   bool write_fault, bool *writable);
#endif
